home *** CD-ROM | disk | FTP | other *** search
/ Aminet 40 / Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso / Aminet / comm / irc / KuangEleven3Gm.lha / Kuang Eleven 3 / Rexx / Kuang11C.amirx < prev    next >
Text File  |  1998-05-09  |  25KB  |  927 lines

  1. /* $VER: kuang11c.amirx 3.0 (9.5.98) Kuang Eleven 3 Configuration/Userlist commands
  2.    By Ariel Magnum
  3. */
  4. signal on syntax
  5. options results
  6. parse arg command args
  7. command=upper(command);args=strip(args);div=x2c('01')
  8. if getclip('st_init')~=1 then load()
  9. Select
  10.     when command='SENS' then sensors()
  11.     when command='IGTIME' then igtime()
  12.     when command='ASND' then asnd()
  13.     when command='FLOODP' then floodp()
  14.     when command='AGET' then autoget()
  15.     when command='AJOIN' then autojoin()
  16.     when command='PROT' then prot()
  17.     when command='CTCP' then ctcpauto()
  18.     when command='NHP' then nhp()
  19.     when command='AUTOP' then autop()
  20.     when command='FPROT' then fprot()
  21.     when command='RVG' then rvg()
  22.     when command='SHIT' then shit()
  23.     when command='SAVE' then save()
  24.     when command='ADDF' then addf()
  25.     when command='DELF' then delf()
  26.     when command='LISTF' then listf()
  27.     when command='LOAD' then load()
  28.     when command='SAVEF' then savef()
  29.     when command='COMP' then comprefix()
  30.     when command='LISTK' then listk()
  31.     when command='ADDK' then addk()
  32.     when command='DELK' then delk()
  33.     when command='FMSG' then floodmsg()
  34.     when command='CHAN' then chan()
  35.     when command='ADDH' then addh()
  36.     when command='ICON' then icon()
  37.     when command='SETF' then setf()
  38.     when command='BITCH' then deop()
  39.     when command='BITCHC' then deopc()
  40.     when command='LOG' then log()
  41.     when command='PAGE' then page()
  42.     when command='HLOG' then hlog()
  43.     when command='MDEOP' then mdeop()
  44.     when command='MBAN' then mban()
  45.     when command='MUBAN' then muban()
  46.     when command='MOP' then mop()
  47.     when command='MJOIN' then mjoin()
  48.     when command='MKICK' then mop()
  49.     when command='SBAN' then sban()
  50.     when command='PASS' then password()
  51.     when command='RENM' then rename()
  52.     when command='DELH' then delh()
  53.     when command='DISPU' then whois()
  54.     when command='SHOWU' then showu()
  55.     when command='MAXK' then maxk()
  56.     when command='BANK' then bank()
  57.     when command='KICKMSG' then kickmsg()
  58.     when command='CHECK' then check()
  59.     when command='OPDEL' then autopdel()
  60.     when command='RANDEL' then randel()
  61.     when command='AWTXT' then awtxt()
  62.     when command='STYLE' then xstyle()
  63.     when command='SHOWC' then showc()
  64.     when command='AWNICK' then awnick()
  65.     when command='AMSND' then amsound()
  66.     when command='RVGA' then rvgm()
  67.     when command='SAVEB' then saveb()
  68.     when command='DCCLOG' then dcclog()
  69.     when command='IDENT' then ident()
  70.     when command='AWVRB' then awayverb()
  71.     when command='AQUR' then aqur()
  72.     when command='FNET' then fnet()
  73.     otherwise
  74.         pr='KHelp'
  75.         cecho(pr,und(bld('Kuang Eleven Config')))
  76.         cecho(pr,inv('Channel Protection:'))
  77.         cecho(pr,'NHP - NetHack Channel Protection' wt('nhp'))
  78.         cecho(pr,'PROT - Channel Protection' wt('prot'))
  79.         cecho(pr,'MDEOP- Protect from MassDeop' wt('mdeop'))
  80.         cecho(pr,'MBAN - Protect from MassBan' wt('mban'))
  81.         cecho(pr,'MUBAN - Protect from MassUnBan' wt('muban'))
  82.         cecho(pr,'MOP - Protect from MassOp' wt('mop'))
  83.         cecho(pr,'SBAN - Protect from ScrewBans' wt('sban'))
  84.         cecho(pr,'MJOIN - Protect from MassJoin' wt('mjoin'))
  85.         cecho(pr,'SHOWC - Show configuration for this channel')
  86.         cecho(pr,inv('Flood Protection:'))
  87.         cecho(pr,'SENS - Set Sensors')
  88.         cecho(pr,'FLOODP - Flood Protection' wt('floodp'))
  89.         cecho(pr,'FNET - FloodNet Protection' wt('floodnet'))
  90.         cecho(pr,'IGTIME - Set Flood Ignore Time' wt('ig_count'))
  91.         cecho(pr,'FMSG - Set Flood Msg' wt('floodmsg'))
  92.         cecho(pr,inv('Userlist:'))
  93.         cecho(pr,'CHAN - Set AutoChannels' wt('autochannels'))
  94.         cecho(pr,'COMP - Set Channel Command Prefix' wt('comprefix'))
  95.         cecho(pr,'IDENT - Toggle CTCP Ident function' wt('ctcpident'))
  96.         cecho(pr,'PASS - Set global password')
  97.         cecho(pr,'CTCP - CTCP Commands' wt('ctcpauto'))
  98.         cecho(pr,'AUTOP - AutoOp Friends' wt('autop'))
  99.         cecho(pr,'OPDEL - AutoOp delay' wt('autopdel'))
  100.         cecho(pr,'RANDEL- AutoOp delay - random ' wt('randel'))
  101.         cecho(pr,'BITCH - Deop Non Friends' wt('deop') 'on' wt('deopc') '(/KC BITCHC)')
  102.         cecho(pr,'FPROT - Friends Protection' wt('fprot'))
  103.         cecho(pr,'RVG - Revenge Mode' wt('rvg'))
  104.         cecho(pr,'RVGA - Revenge Actions Deop:'wt('rvgd') 'Kick:'wt('rvgk') 'Ban:'wt('rvgb'))
  105.         cecho(pr,'SAVEB - Fast Ban/Deop/Kick when banned' wt('saveban'))
  106.         cecho(pr,'KICKMSG - Friends Protection Kick Msg' wt('pkickmsg'))
  107.         cecho(pr,'ADDF - Add a friend')
  108.         cecho(pr,'DELF - Delete a friend')
  109.         cecho(pr,'ADDH - Add a hostmask to a friend')
  110.         cecho(pr,'DELH - Delete a hostmask from a friend')
  111.         cecho(pr,'SETF - Set flags for friend')
  112.         cecho(pr,'RENM - Rename Friend')
  113.         cecho(pr,'SHOWU - Show user')
  114.         cecho(pr,'CHECK - Check if a user/nick/hostmask is in database')
  115.         cecho(pr,'LISTF - List Friends')
  116.         cecho(pr,'SAVEF - Save Friends list')
  117.         cecho(pr,inv('Kickwords:'))
  118.         cecho(pr,'SHIT - KickWords' wt('shit'))
  119.         cecho(pr,'ADDK - Add a KickWord')
  120.         cecho(pr,'DELK - Delete a KickWord')
  121.         cecho(pr,'LISTK - Show KickWords List')
  122.         cecho(pr,'BANK - Ban on kickwords' wt('bankickwords'))
  123.         cecho(pr,'MAXK - Set number of WordKicks before Ban' wt('maxword'))
  124.         cecho(pr,inv('Away:'))
  125.         cecho(pr,'ICON - Iconify on Away' wt('aicon'))
  126.         cecho(pr,'AWTXT - Send away/back messages' wt('awaytxt'))
  127.         cecho(pr,'AWVRB - Include Loger/Pager status in msg' wt('awayverb'))
  128.         cecho(pr,'AWNICK - Rename to a nick when away' wt('awaynick'))
  129.         cecho(pr,'LOG - Log messages when set away' wt('log'))
  130.         cecho(pr,'HLOG - Log Hilites when set away' wt('hlog'))
  131.         cecho(pr,'DCCLOG - Log Msgs via DCC Chat when set away' wt('dcclog'))
  132.         cecho(pr,'PAGE - Pager' wt('page'))
  133.         cecho(pr,inv('Misc:'))
  134.         cecho(pr,'AJOIN - AutoJoin on Invite' wt('autojoin'))
  135.         cecho(pr,'AGET - DCC AutoGet' wt('autoget'))
  136.         cecho(pr,'AQUR - Open Query Windows' wt('query'))
  137.         cecho(pr,'ASND - AutoSend Sounds' wt('asound'))
  138.         cecho(pr,'AMSND - AutoMove sounds to sounds dir' wt('amsound'))
  139.         cecho(pr,'LOAD - Reload Configurations')
  140.         cecho(pr,'SAVE - Save Configuration')
  141. end
  142. exit
  143.  
  144.  
  145. listf:
  146. flags=lower(args)
  147. if flags~='' then vflags()
  148. pr='FList'
  149. cflags=flags
  150. DROP flags
  151. if ~getusers() then do
  152.     cecho(pr,'Userlist empty')
  153.     exit
  154. end
  155. cn=0
  156. cecho(pr,und(left('Username',10) left('Flags',8) 'Hostmasks'))
  157. do i=1 to users.count
  158.     if verify(cflags,users.i.flags)=0 then do
  159.         cn=cn+1
  160.         hoststr=users.i.hosts.1
  161.         do j=2 to users.i.hosts.count
  162.             hoststr=hoststr||bld('|')||users.i.hosts.j
  163.         end
  164.         cecho(i,bld(left(users.i.nick,10)) inv(left(users.i.flags,8)) hoststr)
  165.     end
  166. end
  167. cecho(pr,bld(cn) 'Matched requested flags' inv(cflags))
  168. exit
  169.  
  170. countf: PROCEDURE EXPOSE cnx
  171. if ~getusers() then exit
  172. f=arg(1);cn=0;cnx=''
  173. do i=1 to users.count
  174.     if verify(f,users.i.flags)=0 then do
  175.         cn=cn+1
  176.         cnx=cnx users.i.nick
  177.     end
  178. end
  179. return cn '(with' f 'flag)'
  180.  
  181. addh:
  182. parse var args nick host .
  183. nick=strip(nick);host=strip(lower(host))
  184. pr='AddHost'
  185. if nick='' then do
  186.     cecho(pr,'Usage: /ADDH nick [hostmask] [NUM]')
  187.     cecho(pr,'Specifying keyword NUM will add the numeric hostmask')
  188.     exit
  189. end
  190. if host='num' then host='numeric'
  191. vhost()
  192. SELECT
  193.     WHEN AddUserHost(nick,host) then do
  194.         report(bld(nick) 'added with host' bld('[')||host||bld(']'))
  195.         if uexists(nick) then notice(nick,'Added with host' bld('[')||host||bld(']'))
  196.     end
  197.     WHEN RC=1 then report(bld(nick) 'is not on userlist')
  198.     WHEN RC=2 then report(bld(nick) 'already has host' bld('[')||host||bld(']'))
  199. OTHERWISE
  200. report('General Program Fault')
  201. END
  202. return 0
  203.  
  204. rename:
  205. parse var args nick tnick
  206. nick=strip(nick);tnick=strip(tnick);
  207. pr='Rename'
  208. if nick=''|tnick=''|upper(nick)=upper(tnick) then do
  209.     cecho(pr,'Usage: /RENM nick newnick')
  210.     exit
  211. end
  212. SELECT
  213.     when RenameUser(nick,tnick) then do
  214.         report(bld(nick) 'renamed to ' bld(tnick))
  215.         if verify(flags,'db','M')==0 then do
  216.             if uexists(tnick) then notice(tnick,'Renamed to' bld(tnick) 'in userlist')
  217.             else if uexists(nick) then notice(nick,'Renamed to' bld(tnick) 'in userlist')
  218.         end
  219.     end
  220.     when RC=1 then report(bld(nick) 'is not on userlist')
  221.     when RC=2 then report(bld(tnick) 'already exists')
  222. otherwise
  223. report('General Program Fault')
  224. end
  225. exit
  226.  
  227. setf:
  228. parse var args nick flags .
  229. nick=strip(nick);flags=strip(lower(flags))
  230. pr='SetFlags'
  231. if nick=''|flags='' then do
  232.     cecho(pr,'Usage: /SETF user flags')
  233.     cecho(pr,'/ADDF to see list of flags')
  234.     exit
  235. end
  236. vflags()
  237. IF ~SetUserFlags(nick,flags) then do
  238.     report(bld(nick) 'is not on userlist')
  239.     exit
  240. end
  241. report(bld(nick) 'set with flags' inv(flags))
  242. if verify(flags,'db','M')==0&uexists(nick) then notice(nick,'Set with flags' inv(flags))
  243. exit
  244.  
  245. addf:
  246. parse var args nick flags host
  247. nick=strip(nick);host=strip(lower(host));flags=strip(lower(flags))
  248. pr='AddFriend'
  249. if flags='' then do
  250.     cecho(pr,'Usage: /ADDF nick flags [hostmask]|[NUM]')
  251.     cecho(pr,'Specifying keyword NUM will' bld('also add') 'the numeric hostmask')
  252.     cecho(pr,bld('Flags are:'))
  253.     cecho(pr,'o - AutoOp')
  254.     cecho(pr,'x - XDCC Sec')
  255.     cecho(pr,'i - Invite')
  256.     cecho(pr,'p - Protect')
  257.     cecho(pr,'d - Deop')
  258.     cecho(pr,'b - Ban')
  259.     cecho(pr,'a - AutoGet DCC')
  260.     cecho(pr,'c - CTCP/Channel commands')
  261.     cecho(pr,'e - Voice')
  262.     cecho(pr,'v - Bot')
  263.     cecho(pr,'s - Sysop')
  264.     cecho(pr,bld('Presets are:'))
  265.     cecho(pr,'all - oxipc')
  266.     cecho(pr,'bot - vop')
  267.     exit
  268. end
  269. vhost()
  270. if getuser(nick) then do
  271.     addh()
  272.     setf()
  273. end
  274. vflags()
  275. if ~adduser(nick,flags,host) then exit
  276. if verify(flags,'db','M')==0&uexists(nick) then do
  277.     notice(nick,'You have been added to my friends list with flags' flags)
  278.     notice(nick,bld('/CTCP' getnick() 'HELP') 'to get access help')
  279. end
  280. report('Added' bld(nick) inv(flags) bld('[')||host||bld(']'))
  281. exit
  282.  
  283. showu:
  284. pr='ShowUser'
  285. if args='' then do
  286.     cecho(pr,'Usage: /SHOWU user')
  287.     exit
  288. end
  289. if ~getuser(args) then do
  290.     report(args 'not found')
  291.     exit
  292. end
  293. h=user.hosts.1
  294. do i=2 to user.hosts.count
  295.     h=h||bld('|')||user.hosts.i
  296. end
  297. args=user.nick h user.flags
  298. whois()
  299.  
  300. delh:
  301. parse var args nick host
  302. nick=strip(upper(nick));host=strip(lower(host))
  303. pr='DelHost'
  304. if nick='' then do
  305.     cecho(pr,'Usage: /DELH nick hostmask')
  306.     exit
  307. end
  308. vhost()
  309. SELECT
  310.     WHEN deleteuserhost(nick,host) then do
  311.         report(bld(nick) 'Removed host' bld('[')||host||bld(']'))
  312.         if uexists(nick) then notice(nick,'Removed host' bld('[')||host||bld(']'))
  313.     end
  314.     WHEN RC=1 then report(bld(nick) 'does not have host' bld('[')||host||bld(']'))
  315.     WHEN RC=2 then report(bld(nick) 'has only one hostmask')
  316.     WHEN RC=3 then report(bld(nick) 'is not on userlist')
  317. OTHERWISE
  318. report('General Program Fault')
  319. END
  320. exit
  321.  
  322. report:
  323. rsys=getclip('st_rsys')
  324. if rsys~='' then do
  325.     call setclip('st_rsys')
  326.     notice(rsys,arg(1))
  327. end
  328. cecho(pr,arg(1))
  329. return 0
  330.  
  331. vflags:
  332. if verify(flags,'oxipdbacves'xrange(1,9))~==0 then do
  333.     Select
  334.         when flags='all' then flags='oxipc'
  335.         when flags='bot' then flags='vop'
  336.     otherwise
  337.         cecho(pr,'Illegal flags' bld(flags))
  338.         exit
  339.     end
  340. end
  341. return 0
  342.  
  343. vhost:
  344. if pos('@',host)=0 then do
  345.     nick=resnick(nick)
  346.     if ~uexists(nick) then do
  347.         cecho(pr,bld(nick) 'does not exist')
  348.         exit
  349.     end
  350.     hs=lower(gethost(nick))
  351.     p=pos('@',hs)
  352.     user=translate(substr(hs,1,p),'**','+~');ip=substr(hs,p+1)
  353.     Select
  354.         when host='numeric' then host=user||getdomain(getnumip(ip))
  355.         when host='num' then host=user||getdomain(ip)'+'user||getdomain(getnumip(ip))
  356.     otherwise
  357.         host=user||getdomain(ip)
  358.     end
  359. end
  360. return 0
  361.  
  362.  
  363. delf:
  364. pr='DelFriend'
  365. if args='' then do
  366.     cecho(pr,'Usage: /DELF user')
  367.     exit
  368. end
  369. if ~getuser(args) then do
  370.     cecho(pr,'Unknown user' args)
  371.     exit
  372. end
  373. call deleteuser(args)
  374. h=user.hosts.1
  375. do i=2 to user.hosts.count
  376.     h=h||bld('|')||user.hosts.i
  377. end
  378. cecho(pr,'Removed' bld(user.nick) inv(user.flags) bld('[')||h||bld(']'))
  379. exit
  380.  
  381.  
  382. savef:
  383. pr='Save'
  384. IF SaveUsers() THEN report('Saved userlist.')
  385. ELSE report('Error saving userlist.')
  386. exit
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393. /* ## Shared functions here
  394. */
  395. wt:PROCEDURE;x=getclip('sc_'||lower(arg(1)));if x='' then x='UNSET';return '['bld(x)']'
  396. toggle:;t='sc_'||lower(arg(1));if getclip(t)='ON' then x='OFF';else x='ON';call setclip(t,x);return '['bld(x)']'
  397. cecho:;"ECHO P="d2c(27)"b«"arg(1)"» TEXT" arg(2);return 0
  398. vecho:;"ECHO P="d2c(27)"b«KConfig»" und(arg(1)||':') arg(2)'.';return 0
  399. verifynarg:;return datatype(arg(1),'N')&arg(1)~='.'
  400. notice:;'RAW NOTICE' arg(1) ':'arg(2);return 0
  401. getnick:;"GETMYNICK";return result
  402. gethost: "USERHOST" arg(1);return result
  403. uexists: if pos('@',gethost(arg(1)))~==0 then return 1;else return 0
  404. ctcpreply:;'RAW NOTICE' arg(1) ':'div||command arg(2)div;return 0
  405. amrx:;'SAY /RX' arg(1);return 0
  406.  
  407. resnick:PROCEDURE
  408. tnick=arg(1)
  409. Select
  410. when pos('@',tnick)~=0 then do
  411.     "GETSELECTEDUSER"
  412.     tnick=result
  413. end
  414. when pos('*',tnick)~=0 then do
  415.     "GETUSERS"
  416.     users=compress(result,'@+')
  417.     nix='';upper tnick
  418.     do until users=''
  419.         parse var users nick users
  420.         "MATCHUSERHOST" nick'!*@*' tnick'*!*@*'
  421.         if rc=1 then nix=nix nick
  422.     end
  423.     tnick=strip(nix)
  424.     if tnick='' then do
  425.         cecho('MatchNick','Unable to match')
  426.         exit
  427.     end
  428.     if words(tnick)>1 then do
  429.         cecho('MatchNick','Multiple nicks found :' tnick)
  430.         exit
  431.     end
  432. end
  433. otherwise
  434. end
  435. return tnick
  436. syntax:
  437. "ECHO" "P=Syntax" "Command on line" SIGL "returned" RC ":" errortext(rc) sourceline(SIGL)
  438. exit
  439. /* #### Commands here
  440. */
  441. chanpass:;achan=getclip('sc_autochannels');if achan=='ALL' then return 1;if find(achan,upper(channel))~==0 then return 1;return 0
  442.  
  443. showc:
  444. pr='Channel'
  445. "GETCHANNEL"
  446. channel=result
  447. if ~chanpass() then do
  448.     cecho(pr,Channel 'not enabled')
  449.     exit
  450. end
  451. prot=getclip('sc_prot');fprot=getclip('sc_fprot');autop=getclip('sc_autop');sban=getclip('sc_sban');rvg=getclip('sc_rvg')
  452. deop=getclip('sc_deop')
  453. if deop=='ON'|deop=='FRIENDS' then do
  454.     x=getclip('sc_deopc')
  455.     if x~=='ALL' then if pos(upper(channel),x)==0 then break
  456.     dopnf='ON'
  457. end
  458.  
  459. cecho(pr,inv(Channel 'Enabled with:'))
  460. If prot=='ON' then do
  461.     cecho(pr,bld('Channel protection enabled'))
  462.     str=''
  463.     cecho(pr,'MassModes Protection: MassDeop' wt('mdeop') 'MassOp' wt('mop') 'MassBan' wt('mban') 'MassUnBan' wt('muban') 'Sensor' wt('sensormode'))
  464.     if getclip('sc_sban')=='ON' then cecho(pr,'Screwbans will be auto-removed')
  465.     if getclip('sc_nhp')=='ON' then do
  466.         cecho(pr,'Nethack protection is enabled')
  467.         cecho(pr,countf('o') 'users ignored for nethacking')
  468.     end
  469.     cecho(pr,countf('v') 'users ignored for channel protection.')
  470. end
  471. if fprot='ON' then do
  472.     cecho(pr,bld('Friends protection enabled'))
  473.     cecho(pr,countf('p') 'protected users.')
  474.     cecho(pr,countf('v') 'users will not be protected from.')
  475.     select
  476.         when rvg='ON' then cecho(pr,'Revenge enabled on all users.')
  477.         when rvg='NONP' then cecho(pr,'Revenge enabled on non-protected users')
  478.     otherwise
  479.         cecho(pr,'Friends Kick Protection disabled')
  480.         cecho(pr,'Revenge disabled')
  481.     end
  482. end
  483. if dopnf='ON' then do
  484.     cecho(pr,bld('BiTcH mode enabled'))
  485.     cecho(pr,countf('v') 'ignored users may give ops')
  486.     if deop='FRIENDS' then cecho(pr,countf('o') 'other users may give ops')
  487. end
  488. cecho(pr,bld('Friends'))
  489. if autop='ON' then cecho(pr,countf('o') 'users opped on join')
  490. else cecho(pr,'AutoOps disabled')
  491. cecho(pr,countf('e') 'users voiced on join')
  492. cecho(pr,countf('b') 'users banned on join')
  493. cecho(pr,countf('d') 'users disallowed ops')
  494. if getclip('sc_comprefix')~='' then do
  495.     cecho(pr,bld('Channel commands enabled'))
  496.     cecho(pr,countf('s') 'remote sysops with friends list access')
  497.     cecho(pr,countf('c') 'users allowed to access remote commands')
  498. end
  499. else cecho(pr,'Channel commands disabled')
  500. exit
  501.  
  502. check:
  503. if args='' then do
  504.     cecho('CheckUser','Usage : /kc CHECK [NICK]|[USER]|[HOSTMASK]')
  505.     exit
  506. end
  507. amrx('kuang11.AMIRX :'args 'whois')
  508. exit
  509.  
  510. rvgm:
  511. pr='RevengeAct'
  512. upper args
  513. if args='' then do
  514.     cecho(pr,'Usage : /kc RVGA [KICK] [BAN] [DEOP]')
  515.     exit
  516. end
  517. if pos('KICK',args)=0 then call setclip('sc_rvgk','OFF');else call setclip('sc_rvgk','ON')
  518. if pos('BAN',args)=0 then call setclip('sc_rvgb','OFF');else call setclip('sc_rvgb','ON')
  519. if pos('DEOP',args)=0 then call setclip('sc_rvgd','OFF');else call setclip('sc_rvgd','ON')
  520. cecho(pr,'Deop:'wt('rvgd') 'Kick:'wt('rvgk','OFF') 'Ban:'wt('rvgb'))
  521. exit
  522.  
  523. bank:
  524. vecho('KickWords Ban',toggle('bankickwords'))
  525. if getclip('sc_bankickwords')='ON'&getclip('sc_maxword')='' then do
  526.     args=3
  527.     maxk()
  528. end
  529. exit
  530.  
  531. maxk:
  532. pr='Maximum WordKicks'
  533. x=getclip('sc_maxword')
  534. args=strip(args)
  535. if ~datatype(args,'W') then vecho(pr,'Usage : /kc MAXK <N>')
  536. else do
  537.     call setclip('sc_maxword',args)
  538.     x=args
  539. end
  540. vecho(pr,'Currently set to' bld(x))
  541. exit
  542.  
  543. awtxt:
  544. x=getclip('sc_awaytxt')
  545. Select
  546.     when x=''|x='OFF' then x='TEXT'
  547.     when x='TEXT'|x='ON' then x='SOUND'
  548.     when x='SOUND' then x='BOTH'
  549. otherwise
  550.     x='OFF'
  551. end
  552. call setclip('sc_awaytxt',x)
  553. vecho('Away Messages','['bld(x)']')
  554. exit
  555.  
  556. autoget:
  557. x=getclip('sc_autoget')
  558. Select
  559.     when x='OFF'|x='' then x='ALL'
  560.     when x='ALL' then x='ALLFRIENDS'
  561.     when x='ALLFRIENDS' then x='FRIENDS'
  562. otherwise
  563.     x='OFF'
  564. end
  565. call setclip('sc_autoget',x)
  566. cecho('Autoget','['bld(x)']')
  567. exit
  568.  
  569. autojoin:
  570. x=getclip('sc_autojoin')
  571. select
  572.     when x='OFF'|x='' then x='ALL'
  573.     when x='ALL' then x='FRIENDS'
  574. otherwise
  575.     x='OFF'
  576. end
  577. call setclip('sc_autojoin',x)
  578. cecho('AutoJoin','['bld(x)']')
  579. exit
  580.  
  581. asnd:
  582. vecho('AutoSend Sounds',toggle('asound'))
  583. if getclip('sc_asound')='ON' then do
  584.     x=getnick()
  585.     'SAY /HILITE "!'||x||'"'
  586.     call setclip('st_asoundnick',x)
  587. end
  588. else do
  589.     x='!'||getclip('st_asoundnick')
  590.     if getclip('sc_comprefix')~=x&find(getclip('sc_swords'),x)=0 then 'SAY /UNHILITE "'||x||'"'
  591. end
  592. exit
  593.  
  594. deopc:
  595. pr='AutoDeop Non-Friends Channels'
  596. if args='' then do
  597.     vecho(pr,'Usage : /KC BITCHC [#CHANNEL]|[ALL] <#CHANNEL> ...')
  598. end
  599. else do
  600.     call setclip('sc_deopc',upper(args))
  601. end
  602. vecho(pr,'['getclip('sc_deopc')']')
  603. exit
  604.  
  605. deop:
  606. x=getclip('sc_deop')
  607. select
  608.     when x='OFF'|x='' then x='FRIENDS'
  609.     when x='FRIENDS' then x='ON'
  610. otherwise
  611.     x='OFF'
  612. end
  613. call setclip('sc_deop',x)
  614. vecho('AutoDeop Non-Friends','['bld(x)']')
  615. exit
  616.  
  617.  
  618. rvg:
  619. x=getclip('sc_rvg')
  620. select
  621.     when x='OFF'|x='' then x='NONP'
  622.     when x='NONP' then x='ON'
  623. otherwise
  624.     x='OFF'
  625. end
  626. call setclip('sc_rvg',x)
  627. cecho('Revenge','['bld(x)']')
  628. exit
  629.  
  630. page:
  631. pr='Pager'
  632. x=getclip('sc_page')
  633. Select
  634.     when x='OFF'|x='' then x='ON'
  635.     when x='ON' then x='FRIENDS'
  636. otherwise
  637.     x='OFF'
  638. end
  639. call setclip('sc_page',x)
  640. cecho(pr,'['bld(x)']')
  641. exit
  642.  
  643. kickmsg:
  644. pr='Kick Reason'
  645. x=getclip('sc_pkickmsg')
  646. args=strip(args)
  647. if args='' then do
  648.     vecho(pr,'Usage : /kc KICKMSG [Msg]')
  649. end
  650. else do
  651.     call setclip('sc_pkickmsg',args)
  652.     x=args
  653. end
  654. vecho(pr,'Currently set to' bld(x))
  655. exit
  656.  
  657. awnick:
  658. pr='AwayNick'
  659. x=getclip('sc_awaynick')
  660. args=strip(args)
  661. if args='' then do
  662.     cecho(pr,'Usage : /kc AWNICK [Nick]')
  663. end
  664. else do
  665.     call setclip('sc_awaynick',args)
  666.     x=args
  667. end
  668. cecho(pr,'Currently set to' bld(x))
  669. exit
  670.  
  671. floodmsg:
  672. pr='Flood Message'
  673. x=getclip('sc_floodmsg')
  674. args=strip(args)
  675. if args='' then do
  676.     vecho(pr,'Usage : /kc FLOODMSG [Msg]')
  677. end
  678. else do
  679.     call setclip('sc_floodmsg',args)
  680.     x=args
  681. end
  682. vecho(pr,'Currently set to' bld(x))
  683. exit
  684.  
  685. Password:
  686. pr='Password'
  687. x=getclip('sc_password')
  688. args=strip(args)
  689. if args='' then do
  690.     cecho(pr,'Usage : /kc PASS [PASSWORD]')
  691. end
  692. else do
  693.     call setclip('sc_password',args)
  694.     x=args
  695. end
  696. cecho(pr,'Currently set to' bld(x))
  697. exit
  698.  
  699. chan:
  700. pr='Channels'
  701. x=getclip('sc_autochannels')
  702. args=strip(upper(args))
  703. if args='' then do
  704.     cecho(pr,'Usage : /kc CHAN [#CHANNEL1] <#CHANNEL2> ... or  ALL')
  705. end
  706. else do
  707.     call setclip('sc_autochannels',args)
  708.     x=args
  709. end
  710. cecho(pr,'Currently set to' bld(x))
  711. exit
  712.  
  713. comprefix:
  714. pr='ComPrefix'
  715. args=strip(upper(args))
  716. com=getclip('sc_comprefix')
  717. if args='' then cecho(pr,'Usage : /kc COMP [PREFIX]')
  718. else do
  719.     call setclip('sc_comprefix',args)
  720.     if find(getclip('sc_swords'),com)=0 then 'SAY /UNHILITE "'com'"'
  721.     'SAY /HILITE "'args'"'
  722.     com=args
  723. end
  724. cecho(pr,'Currently set to' bld(com))
  725. exit
  726.  
  727. addk:
  728. args=strip(upper(args))
  729. if args='' then do
  730.     cecho('AddKWord','Usage : /kc ADDK [KICKWORD]')
  731. end
  732. else do
  733.     'SAY /HILITE "'args'"'
  734.     call setclip('sc_swords',getclip('sc_swords') args)
  735. end
  736.  
  737. listk:
  738. cecho('KickWords','Currently set to' bld(getclip('sc_swords')))
  739. exit
  740.  
  741. delk:
  742. pr='DelKWord'
  743. args=strip(upper(args))
  744. x=getclip('sc_swords')
  745. if args='' then do
  746.     cecho(pr,'Usage : /kc DELK [KICKWORD]')
  747.     listk()
  748. end
  749. do i=1 to words(x)
  750.     if word(x,i)=args then do
  751.         call setclip('sc_swords',strip(delword(x,i,1)))
  752.         if getclip('sc_comprefix')~=args then 'SAY /UNHILITE "'args'"'
  753.         listk()
  754.     end
  755. end
  756. cecho(pr,bld(args) 'not found in KickWords List')
  757. exit
  758.  
  759. load:
  760. pr='Reload'
  761. cecho(pr,'Clearing configuration...')
  762. c=show('C')
  763. do until c=''
  764.     parse var c w c
  765.     if substr(w,1,3)='sc_' then call setclip(w)
  766. end
  767. call setclip('st_init')
  768. cecho(pr,'Loading configuration from disk...')
  769. if args='' then do
  770.     amrx('connected.amirx')
  771. end
  772. exit
  773.  
  774. save:
  775. pr='Save'
  776. fn='Kuang11/Config'
  777. if ~open(f,fn,'W') then do
  778.     cecho(pr,'Failed to open file' fn)
  779.     exit
  780. end
  781. l=show('c')
  782. do i=1 to words(l)
  783.     x=strip(word(l,i))
  784.     if substr(x,1,3)='sc_' then writeln(f,substr(x,4) getclip(x))
  785. end
  786. close(f)
  787. cecho(pr,'Saved configuration')
  788. exit
  789. sban:;vecho('ScrewBan Protection',toggle('sban'));exit
  790. mdeop:;vecho('MassDeop Protection',toggle('mdeop'));exit
  791. mban:;vecho('MassBan Protection',toggle('mban'));exit
  792. muban:;vecho('MassUnBan Protection',toggle('muban'));exit
  793. mop:;vecho('MassOp Protection',toggle('mop'));exit
  794. mkick:;vecho('MassKick Protection',toggle('mkick'));exit
  795. mjoin:;vecho('MassJoin Protection',toggle('mjoin'));exit
  796. log:;vecho('Away Logging',toggle('log'));exit
  797. hlog:;vecho('Hilite Away Logging',toggle('hlog'));exit
  798. icon:;cecho('AwayIconify',toggle('aicon'));exit
  799. floodp:;vecho('Flood Protection',toggle('floodp'));exit
  800. fnet:;vecho('FloodNet Protection',toggle('floodnet'));exit
  801. prot:;vecho('Channel Protection',toggle('prot'));exit
  802. ctcpauto:;vecho('Extended CTCP',toggle('ctcpauto'));exit
  803. nhp:;vecho('NetHack Protection',toggle('nhp'));exit
  804. randel:;vecho('Random Delayed Ops',toggle('randel'));exit
  805. autop:;cecho('AutoOp',toggle('autop'));exit
  806. fprot:;vecho('Friends Protection',toggle('fprot'));exit
  807. dcclog:;cecho('DCCLog',toggle('dcclog'));exit
  808. ident:;cecho('CTCPIdent',toggle('ctcpident'));exit
  809. awayverb:;cecho('AwayVerb',toggle('awayverb'));exit
  810. saveb:;cecho('SaveBan',toggle('saveban'));exit
  811. amsound:;vecho('AutoMove Sounds',toggle('amsound'));exit
  812. aqur:;vecho('Query Windows',toggle('query'));exit
  813.  
  814. shit:
  815. cecho('KickWords',toggle('shit'))
  816. l=getclip('sc_swords')
  817. if l~='' then do
  818.     if getclip('sc_shit')='ON' then ou='SAY /HILITE';else ou='SAY /UNHILITE'
  819.     do i=1 to words(l);ou '"'upper(word(l,i))'"';end
  820. end
  821. exit
  822.  
  823. igtime:
  824. pr='IgnoreTime'
  825. x=getclip('sc_ig_count')
  826. if length(args)~=1|datatype(args,'n')=0 then cecho(pr,'Usage: /KC IGTIME <N> (1-9 minutes)')
  827. else do
  828.     call setclip('sc_ig_count',args)
  829.     x=args
  830. end
  831. cecho(pr,'Current setting:' x 'minutes')
  832. exit
  833.  
  834. autopdel:
  835. pr='AutoOpDelay'
  836. x=getclip('sc_autopdel')
  837. if datatype(args,'n')=0 then cecho(pr,'Usage: /KC OPDEL <N> - N is in seconds.0 to disable.')
  838. else do
  839.     if args=0 then args=''
  840.     call setclip('sc_autopdel',args)
  841.     x=args
  842. end
  843. cecho(pr,'Current setting:' x 'seconds')
  844. exit
  845.  
  846. sensors:
  847. if args='' then cecho('Sensors','Usage: /kc SENS <RESET> <MSG> <CTCP> <NOTICE> <DCC> <MODE> <KICK> <JOIN> <INVITE> replace an argument with "." to be skipped')
  848. else do
  849.     parse var args  RESET MSG CTCP NOTICE DCC MODE KICK JOIN INVITE .
  850.     if verifynarg(reset) then call setclip('sc_resetcount',reset)
  851.     if verifynarg(msg) then call setclip('sc_sensorprivmsg',msg)
  852.     if verifynarg(ctcp) then call setclip('sc_sensorctcp',ctcp)
  853.     if verifynarg(notice) then call setclip('sc_sensornotice',notice)
  854.     if verifynarg(dcc) then call setclip('sc_sensordcc',dcc)
  855.     if verifynarg(mode) then call setclip('sc_sensormode',mode)
  856.     if verifynarg(kick) then call setclip('sc_sensorkick',kick)
  857.     if verifynarg(join) then call setclip('sc_sensorjoin',join)
  858.     if verifynarg(invite) then call setclip('sc_sensorinvite',invite)
  859. end
  860. cecho('Sensors','Reset:'getclip('sc_resetcount') 'Msg:'getclip('sc_sensorprivmsg') 'CTCP:'Getclip('sc_sensorctcp') 'Notice:'getclip('sc_sensornotice') 'DCC:'getclip('sc_sensordcc') 'Mode:'getclip('sc_sensormode') 'Kick:'getclip('sc_sensorkick'))
  861. exit
  862.  
  863. whois:
  864. parse var args nk hm fl
  865. acs='';ln3='';cr='0A'x
  866. if pos('c',fl)~=0 then do
  867.     c=1
  868.     acs=acs'CTCP Commands,Channel Commands'
  869.     cp=getclip('sc_comprefix')
  870.     pc=bld('Channel commands Prefix:') cp
  871.     cc=bld('CTCP commands:') 'IDENT HELP WHOIS'
  872. end
  873. if pos('e',fl)~=0 then do;e=1;acs=acs',Voiced On Join';end
  874. if pos('o',fl)~=0 then do
  875.     o=1
  876.     acs=acs',Oped on Join'
  877.     cc=cc 'KICK UNBAN'
  878. end
  879. if pos('i',fl)~=0 then do
  880.     i=1
  881.     acs=acs',Invite'
  882.     cc=cc 'INVITE'
  883. end
  884. if pos('x',fl)~=0 then do
  885.     x=1
  886.     acs=acs',XDCC'
  887.     cc=cc 'XDCC'
  888. end
  889. if pos('p',fl)~=0 then do;p=1;acs=acs',Protected';end
  890. if pos('d',fl)~=0 then do;d=1;acs=acs',DeOped';end
  891. if pos('b',fl)~=0 then do;b=1;acs=acs',Banned';end
  892. if pos('a',fl)~=0 then do;a=1;acs=acs',DCC Autoget';end
  893. if pos('v',fl)~=0 then do;b=1;acs=acs',Bot';end
  894. if pos('s',fl)~=0 then do
  895.     s=1
  896.     acs=acs' , Sysop'
  897.     pc=pc cp'ADDF' cp'ADDH' cp'SETF' cp'SAVE'
  898. end
  899. ln1=und(bld(nk) inv(fl) bld('[')||hm||bld(']'))
  900. ln2=bld('Privileges:') strip(acs,'L',', ')'.'
  901. rsys=getclip('st_rsys')
  902. if rsys='' then do
  903.     pr='ShowUser'
  904.     cecho(pr,ln1)
  905.     cecho(pr,ln2)
  906.     if c=1 then do
  907.         cecho(pr,pc)
  908.         cecho(pr,cc)
  909.     end
  910. end
  911. else do
  912.     call setclip('st_rsys')
  913.     do while getclip('st_wh')=1;call delay(150);end
  914.     call setclip('st_wh',1)
  915.     command='WHOIS'
  916.     ctcpreply(rsys,ln1)
  917.     ctcpreply(rsys,ln2)
  918.     if c=1 then do
  919.         ctcpreply(rsys,pc)
  920.         ctcpreply(rsys,cc)
  921.     end
  922.     vecho('CTCP WHOIS','Sent whois to' bld(rsys) 'about' bld(nk))
  923.     call delay(300)
  924.     call setclip('st_wh')
  925. end
  926. exit
  927.